<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<div class="row storPhone">
	<div class="col-sm-12 toolbar">
		<div class="pull-left">
			<button class="btn btn-white btn-sm" id="btnEdit" name="btnEdit" title="添加" onclick="btnEdit();">
				<i class="fa fa-plus"></i> 添加
			</button>
			<!-- <button class="btn btn-white btn-sm" title="修改" onclick="btnDelSel();">
				<i class="fa fa-file-text-o"></i> 修改
			</button> -->
			<button class="btn btn-white btn-sm" id="btnDel" name="btnDel" title="删除" onclick="btnDelSel();">
				<i class="fa fa-trash-o"></i> 删除
			</button>
			<button id="btnImport" name="btnImport" class="btn btn-white btn-sm" title="导入">
				<i class="fa fa-folder-open-o"></i> 导入
			</button>
			<button id="btnExport" name="btnExport" class="btn btn-white btn-sm" title="导出">
				<i class="fa fa-file-excel-o"></i> 导出
			</button>
			<button class="btn btn-white btn-sm" title="刷新" onclick="Refresh();">
				<i class="glyphicon glyphicon-repeat"></i> 刷新
			</button>
		</div>
		<div class="pull-right">
			<button id="btnSearch" class="btn btn-primary btn-rounded btn-outline btn-sm" onclick="Search();">
				<i class="fa fa-search"></i> 查询
			</button>
			<button id="btnReset" class="btn btn-primary btn-rounded btn-outline btn-sm" onclick="Reset();">
				<i class="fa fa-refresh"></i> 重置
			</button>
		</div>
	</div>
</div>
<script type="text/javascript">
	//Edit('MaterialInfo','新增yzb主材信息');
	function getIndexOf(arr, item){
		var indexVal = -1;
		for(var i=0;i<arr.length;i++){
			if(arr[i]==item) {
				indexVal = i;
				break;
			}
		}
		return indexVal;
	}
	function getPageName() {
		var a = location.href;
        var b = a.split("/");
        var c = b.slice(b.length-1, b.length).toString(String).split("List");
        return c.slice(0, 1);
	}
	function getActionTitle() {
		var actValArray	= new Array("MyMaterials");
		var actTxtArray = new Array("主材信息");
		var indexValue	= getIndexOf(actValArray, getPageName());
		return actTxtArray[indexValue];
	}
	function btnEdit() {
		var actVal = getPageName() + "Info";
		var actTxt = "新增" + getActionTitle();
		Edit(actVal, actTxt);
	}
	function btnDelSel() {
		var actVal = getPageName() + "LogicalDel";
		DelSel(actVal);
	}
	function init() {
		if(getPageName() == "PurchaseOrder") {
			$("#btnEdit").hide();
			$("#btnEdit").attr('disabled',"true");
			/* $("#btnDel").hide();
			$("#btnDel").attr('disabled',"true"); */
		}
		$("#btnImport").hide();
		$("#btnImport").attr('disabled',"true");
		$("#btnExport").hide();
		$("#btnExport").attr('disabled',"true");
	}
	init();
</script>